package com.usian.skill.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.usian.skill.pojo.Goods;
import com.usian.skill.vo.GoodsDetailVo;
import com.usian.skill.vo.GoodsVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsMapper extends BaseMapper<Goods> {
    List<GoodsVo> findAll();

    @Select("select g.*,mg.stockCount,mg.startDate,mg.endDate,mg.miaoshaPrice from skill_goods mg left join goods g on mg.goodsId=g.id where g.id=#{goodsId} and mg.stockCount>0")
    GoodsVo findById(long goodsId);
}
